'Pet' first came into use in 1508, when it was used as a term of endearment for a child--usually a spoiled one.
By 1539 it's meaning had expanded to include domestic animals--you could now have a pet child and a pet monkey.
In 1515 another 'pet' came into use, a verb this time. It was a modified form of the Italian petto, meaning 'to fart' (most likely this is an example of onomatopoeia). This meaning has since been dropped.
The reference to house-hold animals as pets developed into into another verb, meaning 'to fondle', or 'to stroke'. The most recent development took place in North America, where it's usage was expanded to include the fondeling of humans, specificaly a member of the opposit sex.