For goodness’ sake GET A NATIVE ENGLISH SPEAKER TO PROOFREAD THIS.
Yes i think "the attention" distorts the meaning. It could mean "its attention" the pigs. Or it could mean the attention of onlookers.
If " the" is left out then its mostly about the pig.
I think the confusion comes from the way the pig is standing on the cake and not eating it