Those smooth sticks and logs you see washed up on the beach are known as driftwood. They've been worn by the motion of the water over time.
You can find driftwood on the shore of oceans, lakes, and rivers, where it's been tossed by the tide or blown by the wind. While driftwood is officially a type of debris or trash, it's often quite lovely, smoothed into interesting shapes by the water. Driftwood can originate from shipwrecks, rotted pilings, or trees that have been washed into the sea by storms. As it decomposes, beached ocean driftwood often forms the foundation of sand dunes.