Changing sources of nutrients during four million years of ecosystem development