It has naturally been assoc. with PET sb.1, as being a characteristic habit of a "pet" or indulged and spoiled child; but the connexion of sense is not very clear or simple .... [OED]
Related: Pettishly; pettishness.[pettish etymology, pettish origin, 英语词源]