Amp power is generally rated in continuous average sine wave power, determined by the RMS voltage right at the onset of clipping into a certain load resistance. Reputable amp companies generally don't use "peak" or "music" power ratings.
Loudspeaker power handling is generally specified as
continuous power (AKA "RMS") or
program power. A continuous power rating is how much average power the loudspeaker system can take over a period of time. It is essentially a thermal rating, because nearly all of the power put into a loudspeaker is wasted as heat (their efficiciency is roughly equivalent to incandescent light bulbs). So if a speaker is rated for 300 watts continuous power and you put an average of 350 watts into it for maybe a few minutes, there's a significant chance that a voice coil will melt and cause the driver to fail.
A program power rating is usually about
double the continuous rating. It is a roundabout way of saying this is a safe maximum amp power point for most users. Why is it safe to use a 600-watt amp to drive a 300-watt (continuous) speaker? Because the amp isn't putting out full power most of the time. In fact, even if the peaks clip a little (meaning they're hitting just beyond full power), the amp is usually putting out less than 1/3 of full power (more likely, even less than 1/6), averaged out over time. So if you avoid significant clipping, your speaker(s) will be safe.
That doesn't mean that you
must use that much power. If you use less power but can get the sound you want without clipping, that's fine, although it may mean that you bought more speaker than you actually need.
You are underpowered if your amp doesn't have enough power to achieve the sound levels you want without clipping. But there is no such thing as "underpowering" a loudspeaker.