The Fish Trap is a way to gather food in Age of Empires II. The only unit that can build them are Fishing Ships, as they are built on water (although after placed on the map, villagers can help build them if they are close enough to the shoreline). They can be thought of as aquatic farms, and as with farms, it is best not to build them until after the schools of fish have run out.
Dried and salted fish were valuable commodities in the Middle Ages because they were a source of protein that could be transported and store. Cod caught off Iceland and Norway was an especially valuable resource. Fishing technology improvements included the fish trap that allowed the netting of fish migrating up rivers and in coastal areas.