Fertile soil is the ideal soil for growing crops, and will give better yields than regular soil. When a yield of crops is harvested from a tile of fertile soil, the quality of the fertile soil is lowered and turned into regular soil. This also affects the underlying layers of fertile soil. You can fertilize the soil with dung to improve the top layer back to fertile soil.
When terraforming swamps the ground yields fertile soil, but in quantities of 15, not 30.
You may determine the quality of the soil via "lower ground level" and moving the mouse cursor over the soil in your inventory. (Be sure to then put the soil BACK: If lowered from the tile you are standing on, just double-click it, otherwise remain pointing to where you got it and do "Raise Ground Level"—making sure you don't have OTHER soil in your inventory which it might choose.)
You can use the above technique to determine the effectiveness of your dung / fertilizer - inspect, put back, fertilize, inspect again, put back. From experience, it may take from 1 to 25 dung to return the soil to Fertile Soil, Q100, depending upon the previous soil type and quality.