Every Crop keeps track its own nutrients. Fertilizer adds 100 to this value, if it is currently below 100. Maintaining a higher nutrient value may be required for some more advanced plants to grow and it also likely affects growth of plants.The nutrient value decreases over time if there is a crop planted in the crop block.
Some biomes may affect nutrition. The best biome for nutrients is a swamp, with jungles and mushroom biomes being second best.
Bonemeal can also be used to fertilize plants, however is unknown how much it increases the nutrient value.
There is no method to determine the nutrient value a crop has at any given time.