When gas turbines are designed, a baseline atmospheric condition (typically 59F at sea level) is specified to determine nominal power. Gas turbines produce power as a function of many variables, but temp and pressure are two big ones (pressure can be further divided into static and dynamic, but that goes beyond the scope).
Power output decreases with increasing temperature and with decreasing pressure. In other words, power output is proportional to pressure and inversely proportional to temp. As altitude increases, the pressure drops, but the temp decreases as well.
BUT the overall power of the engine decreases, as the pressure loss plays a larger factor in decreasing power than the temp decrease plays in increasing it.
Now, for your question. A flat rating simply means the engine has enough power to maintain a specified power level to a certain altitude (ie pressure and temp).
Let's say a Pratt PT6 on a B1900D is flat rated to 1300 hp at 18,000 feet (I'm making these parameters up). It will produce 1300 hp at 18,000 feet. Conversely, it could be able to produce much more power on the ground at say, sea level and 59F. But this power is limited by the Exhaust Gas Temp (egt) by the operator and the fuel control, or a FADEC (full authority digital engine control).
The egt is restricted on the ground and as the a/c climbs, the egt is allowed to increase, so that the egt is at its max limit at 18,000. The engine in this example produced 1300 hp from ground level up to 18,000 feet, and will then decrease above 18,000. This engine was FLAT RATED at 1300 hp to 18,000 feet. This same engine probably has a THERmodynamic rating in the neighborhood of 1900 horsepower at 59F and sea level.
Hope that helps.