As an example, look at Earth's only confirmed Trojan

By Phoenix7777 - Own work Data source: HORIZONS System, JPL, NASA, CC BY-SA 4.0, source
Now, to understand what is happening here. The yellow dot is the sun. The blue dot is the Earth. Although the Earth is orbiting the sun, the "camera" is turning so that it appears that the Earth is roughly stationary (it wobbles slightly due to the eccentricty of the earth's orbit)
The pink dot is the asteroid 2010 TK7. It has an orbit that is eccentric, and so sometimes it is much closer to the sun than the Earth, and at other times it is further, but its orbit takes nearly exactly one year. However the exact shape of the orbit changes, sometimes it moves around the sun in slightly less than a year, so it starts to catch up with the Earth, but as it nears the Earth, the Earth's gravity tends to pull it forward, and out, causing it to slow down and move away from the earth. The whole cycle takes hundreds of years.
Note, the actual shape of the orbits are elliptical about the sun, the odd shapes is a result of the camera turning at one revolution per year.
This kind of orbit is said to librate about the L4 point. It is called a "tadpole orbit" Trojans don't have to remain exactly at the L4 point, they can stably orbit in a tadpole orbit around the L4 point.