they looked like they were trained to do that like what a talented farmer
I wouldn't imagine they were trained.
Cows do weird things.
Also, they stick to herd movement. It only takes a few to be attracted or curious and the rest follow.
At an old house I used to live in we had a field next to the garden and it had cows in it for half the year. If a couple of them were there and they saw you next to the fence they'd come on over if you called at them, and soon others from further away would just follow, even if you'd stopped making noises.