Spits are essentially just beaches that stick out into the sea.
They are joined to the coast at one end.
If a spit sticks out so far that it connects with another bit of mainland, this is called a bar.
To sum up, spits and bars by the process of Long-shore drift