The earth is 4.6 billion years old and during these years it has never stopped transforming, sometimes at a faster pace, sometimes at a lower pace. there were points in time where even our tallest mountain (the himalaya) did not exist and the continents were not shaped as they are now. the tectonic plates underneath the crust are responsible for these transformation. as they move and build up tension between them, the continents move and mountains are created. the oldest fossils from the sea are over 600 million years old, enough time for the tectonic plates to move around considerably. thus, if you are on a mountain and find shells, while it is not impossible that it washed up from a nearby lake or that some animals made their way to the land, it is much more probable that you are looking at the fossilized remains of organisms that lived under the sea and due to the motion of the tectonic plates, the floor of the sea they used to inhabit became a mountain.