This position expression is actually made up of 2 expressions. First part, w and h, find center of the composition, no matter how big the composition is.
Second part, x, creates a sinwave. By combining it with Math.PI, which is Pi formula, we get perfect sinwave generated with time. With few variables, amplitude, frequency and time, we can speed this sinwave or slow it down. You can make it move more or less.
Sinwave simply works by going from 0 to 1, then back to 0 and 0 to – 1. By using variables for parameters, you can keyframe them, if linked to a slider or manually edit them. You can play with the values, that you can make this motion loop within your composition duration.
Final step is to combine both expressions in a simple array to get final position, that is animated over time, without any keyframes.