The earliest form of an excretory organ appears in the platyhelminthes. Earthworms have nephridia as excretory organs. Vertebrates have nephrons that make up kidneys.
Animals require different individual salt concentrations than their environments.
Animals may have integuments that are not very good barriers to salts or water or they may be nearly impermeable to salt and water. Feeding will add salts and some water to an animal's body. Drinking will add water or salt. Terrestrial animals may lose water when cooling themselves or when respiring. Aquatic animals' respiratory surfaces can not be very impermeable to water and salt and still be permeable to dissolved gases.