Blender Secrets - Copy animation from one object to another
To copy animation from one object to another, select the object you want to animate, then select the object you want to copy animation from.
Now press Ctrl+L and choose "Animation Data".
As the animation data is now linked, changing the animation on one object also changes the animation on the other.
To prevent this, make the object "single user".
Go to Object > Relations > Make Single User > Object Animation > All.
Now you can edit the animation of each object independently.
You can even do this with armatures, as long as they are the same.