Please refer to If kernel_task is using a large percentage of your Mac CPU ... including the links within it.
If you are unable to correlate it with anything in particular (which appears to be the case, based upon your description), then an SMC Reset is justified. That should fix it.
If it doesn't, and it continues to appear without justification, a hardware problem is likely to be the cause. Given its intermittent nature though, diagnosis can be difficult. Consider using Apple Diagnostics / Apple Hardware Test, which will readily identify an inoperative exhaust fan (for example): How to use Apple Diagnostics on your Mac - Apple Support. Other hardware-specific causes will require more extensive testing that isn't generally available outside an Apple Store or AASP.
Try using "Safe Mode" long enough to determine whether the problem persists or not: Use safe mode to isolate issues with your Mac. If kernel_task is its normal quiet self in Safe Mode then you can probably find a software-related cause.
---
A runaway kernel_task can be due to a number of factors, such as:
- a failed or disconnected temperature sensor
- cooling system inefficiency (an inoperative exhaust fan on Macs so equipped, possibly clogged with dust, including the heat sink)
- a worn out, missing, or non-Apple (user-installed) battery on portable Macs
- similar hardware-specific causes including internal hardware additions or modifications, external USB and other connected devices, or the driver software required to use them.