True, but rabbits and guinea pigs are more pets than livestock
Depends on the culture and point of view: if you go to Peru you'll find roasted cavies as food items, and, without going too far, not every European Country sees rabbits as a pet or has different breeds for company and production, or even in the same region there may be different mentalities: a farmer may see a rabbit as livestock and a city person may see it as a pet.
Nonetheless this all comes down to human affection and egoism: humans are all empathic to different degrees and we can extend that empathy beyond our species, even to inanimate entities.
As such, we like to keep close these species and even have physical contact with them as such is the way most of us are taught to express affection; but any down-to-earth person knows that living beings do not live just on affection and one has to manage both the living being and its own emotions, due to most species expressing emotions and reacting to them in different ways.
However, even though a relationship with another living being can be beneficiary to both and, if one's sentiments are true, they only want the best for the other entity, it is born from a sense of selfishness in the pursuit of happiness and wellbeing.
Do I want an animal for co-habitation and physical contact, as that is the way I express my best emotions? Then what I find as a companion animal (and its species or likeness) I will, from that point on, associate to my affections and protection; but not everyone understands the differences and needs of the other animal in what multiple times I saw as a display of selfish happiness: just to name an example, unresponsible owners of dogs and cats.
Do I want an animal to observe, preserve or exhibit it as means to "protect" it and keep within my vicinity, as that is the way I express my best emotions? Then I will do what is in my power to keep it alive and, in good cases, also give it an active and, as much as one can, enthusiastic life (it is a poetic adjective in this case, the concrete term would be a life in which the 5 freedoms are respected and followed), but same point of selsfish happiness applies.
Things do not always coincide, what is happiness for me may not be for another animal and vice versa, and there is a bigger picture and collectivity to take into consideration.
A case example: a person that loves dogs and grew up loving dogs will do everything they can to take care of them by feeding, sheltering, moving and caress them.
The dog is a carnivore, so by nature it needs to feed on someone else in order to live and stay well: someone must die for the dog to be healthy and happy, some animal that could be a farmer's favorite, that is someone's offsping.
The dog is social and needs company, but is also hierarchical, so someone needs to be a subordinate of the dog, possibly being repressed, not expressing the full extent of their happiness or, in alternative, subordinate the dog making it not express its true emotions.
All in all, what I'm trying to say is, as other pointed out: making the best out of everything and consider the whole picture, rather than point fingers and, as an italian saying goes, lookig for the hair in the egg.