In a very basic sense you have an amplifier and it has DC rail voltage. Think of the traditional AC sine wave signal, the DC rail voltage defines how tall that sine wave can get. (Either between rail voltage and a reference of ground potential zero, or a usually equally positive and negative voltage.) Gain of the amplifier (and any upstream preamp) determines the amplitude of the sine wave, but it can only get so big; a transistor cannot get more off than totally off, and it cannot conduct infinitely or beyond. So if you increase gain beyond your rail voltage, your sine wave peaks will be clipped and your sound will be bad.
I.e. Let's say you have a rail voltage of 12 volts. If you have an input signal amplitude of 1 volt and a gain of 5, your output signal amplitude will be 5 volts. If you preamplify the signal to 2 volts (with a gain of 5) your output signal amplitude will be 10 volts. If you stuck with the 1 volt input but increased your amplifier gain (I won't get into how) to 10, you again have a 10 volt output. If you were to increase gain to 15 (or increase the input to accomplish the same thing) you're going to clip the output at 12 volts and the sine wave shape will start looking more square. That is 'running out of voltage' in a nutshell. You can (within limits) adjust the rail voltage of the amp design, this is most easily done with the input transformer for a linear power supply or by bucking up voltage in an SMPS before rectification; if you have an amp with a DC power supply for the most part all you can do is switch out the power supply for higher DC voltage.
Now, you are not hopefully just outputting your amplified signal into an oscilloscope, you're sending it to a load, i.e a speaker or headphones. That load has impedance, i.e. it can flow current between its terminals, but there is resistance that varies based on the frequency of the signal. Since we don't really care about the frequency here we can just think of it as a simple single resistance value. As your amplifier produces output voltage, it tries to apply it across the load, and that generates current as a function of that voltage and the resistance. Think of it like a bucket with a hole in the bottom, as you increase 'voltage' by increasing the water level in the bucket, the current water rushes out the hole more quickly. (In this case some buckets operate upside down and backwards so don't think too hard about it.) Now, here is the key: in order to maintain the output voltage on the load, the amplifier must be able to supply that current. Otherwise, it is as if you couldn't fill the bucket fast enough to overcome the hole, and the level would drop from where you want it. Again your sine wave signal starts looking all squished and screwy.
While output voltage is a fairly simple function of the amplifier design, current supply is a bit more complicated function mainly of the power supply. For a common rectified linear power supply, you depend on capacitors that charge when AC input (again, generally downstream of a transformer, not straight from your wall) is above rail voltage, and discharge when AC is lower, to maintain the DC voltage constant. With an SMPS you are (at high frequency) pulsing energy into a larger capacitor bank while the output current is draining it down. Each design has a finite amount of current it can supply, in the very short term (think fractions of the 60hz input AC cycle) or in the longer term (many 60hz AC cycles.) But you also have internal resistances that can limit current (and drop voltage as they do so) and current through resistance makes heat, which usually makes resistance go up, which drops more voltage internally, etc. So if your power supply is too small, you cannot meet current demand and output voltage collapses, but also as your amp gets too hot it can also get weaker. (Or it can work the other way and go into thermal runaway, which is worse.)
Not only does the distorted wave sound bad, but also the driven load (speaker) is generally designed to need that AC signal to move back and forth reasonably, generating smooth counterelectromotive force and avoiding heat buildup in the motor / voice coil. The distorted / squared off signal is, essentially, the original sine wave plus a lot of higher order harmonics added together. This can sound bad if audible and in general ends up making a bunch of heat, basically because eventually the speaker can't move fast enough to consume the energy as movement. In a multi-way speaker these higher-order harmonics get filtered out from the woofer by the crossover, but they hit the tweeters full blast, which is why clipped signals or 'not having enough amp' tends to fry tweeters. (Lots of things fry tweeters.)