If you're riding a server, the pig doesn't walk smoothly. This is because you tell the server where you are aiming with your carrot on a stick, then the server tells you where the pig is at the moment. So then you don't see the pig walking smoothly but instead you see your position updated once every half seconds. And if you have a bad connection, this can be once every 3 seconds.
So here is my idea: the client tells the server where the pig is. Just like walking. You don't send the pressed keys to the server either.
I hope I explained it well and that what I mean is clear because english is not my first language.