What makes a laptop overheat?
Is there a correlation between CPU usage and heat?
Yes. Most modern-day computers allow the CPU to "down-throttle" at idle, use less power (thus producing less heat). This is why when building desktops, it is common to "burn in" a CPU by using it at 100% load for a few hours to determine the highest temperature that is hit.
It should also be noted that while core frequency does contribute to heat, this effect is much smaller then how much CPU loading causes the temperature to rise. This is because certain instructions use different electrical pathways in the microprocessor. To give a real-world example here, there have been various power viruses written in the past, which take advantage of this fact to repeatedly execute specific machine code which draws the most power (and thus produces the most heat).
RAM usage?
While RAM usage does correlate with how hot the individual memory chips get, this effect is very insignificant compared to CPU/GPU loading (since the memory is clocked at a constant rate). It is highly unlikely to be the cause of any overheating issues.
Other things?
The other two things that come to mind are the GPU and the motherboard itself. As with the CPU, a GPU can down-throttle at idle, and use less power when not in use (and thus resulting in lower temperatures).
The second thing, the motherboard, heats up due to a variety of things. These can be either significant or insignificant, depending on the motherboard architecture itself. For example, some motherboards allow variable loading on their supplied power to devices, which use high frequency voltage regulators. Under load, the duty cycle and frequency of the voltage regulators ramp up to improve your system's stability (at the cost of more heat).
How can software affect overheating in a laptop?
Software is the primary factor which determines CPU and GPU usage, since software essentially controls these hardware devices. As such, using software which constantly loads the CPU will cause any computer to heat up more then it would at idle.
The last thing that most people with a laptop do not think of is the power supply (AC adapter or battery). Regardless of the situation, if your computer needs more power for some reason, your battery or your AC adapter will get hotter with the increase in power draw. I only mention this here, however, because this effect is not as significant as those I have listed above.
One more small addition I think is worth mentioning, is that thermal paste loses it's heat conducting properties over time. This is for a variety of reasons (heat exposure, oxidation, evaporation, etc...), but it is an issue nonetheless. Thermal paste has a few years lifespan in a computer, and afterwards, it may be worthwhile to "re-seat" your heatsinks (both in your desktop and laptop) with new thermal paste.
Put simply, the more complex the task a CPU has to perform, the more power it has to spend in order to solve it quickly, much like driving a car uphill requires more gas. A direct byproduct of this is excess heat.
If your computer is just sat at the desktop, the CPU will only use what it needs to maintain the basic background services and interactivity. If you are doing something very complex like playing modern 3D games or encoding video, power use will ramp up exceptionally.
Of course, as the others said, CPU usage can be a factor if it is running constantly at 100% usage, but to answer the main question, "What makes a laptop overheat?", probably the single biggest thing is not using compressed air to blow out your heat sink/cpu fan.
I recommend doing this on a regular basis, at least monthly, and your laptop will probably live a lot longer.