Rene Descartes viewed animals as machines in the 1600s. He was just one guy, but there were all sorts of accepted and cruel practices in the past like cat burning (https://en.wikipedia.org/wiki/Cat-burning). Why do we care more about animals now? Is it because of urbanization? Better understanding of the science? Any trends we've seen?
I’m going to give an answer that is skewed towards western philosophy and how it is used to justify the extension of moral rights to animals from the Enlightenment era to modernity. However, animal rights were expressed in other cultures and religions, some going back thousands of years (e.g. Jainism).
Jeremy Bentham is arguably a founder of the branch of ethical philosophy known as utilitarianism. In The Principles of Morals and Legislation (1789), he formulated the "greatest happiness principle," which states that happiness and pain are the measures by which we judge an action to be ethical or unethical. John Stuart Mill later expanded Bentham's idea into utility, which can be defined as some desired benefit or value--this could be freedom, happiness, justice, etc. Thus, an action is ethical if it maximizes utility. Bentham’s focus on pain would be later used to apply to animals’ utility.
Fast-forward to the 20th century, philosophy students known as the “Oxford Group” wrote a series of essays and articles that critiqued factory farming, animal testing, and other practices. These essays were collected and published as Animals, Men and Morals (1971). One of the members, Richard Ryder, coined the term “speciesism,” which, in a nutshell, means that we give more moral value to human beings purely because they are members of our own species. The term is not unlike racism, but your defining border is all of humanity.
A relevant concept in ethics is the idea of the “moral community,” wherein members have utility and are entitled to certain rights (e.g. right to life). Intuitively, we would consider all humans to be part of the moral community. But what qualities does one need to be part of the moral community? These qualities must be such that we can include all human beings. One intuitive quality is the capacity for moral action, for how can you be part of a moral community if you can’t distinguish between right and wrong? This quality is problematic because we have mentally disabled (e.g. severe down syndrome, autism) humans that may not possess this moral capacity. In any case, consider the following premises:
Consider the following premises:
(a) A moral action is an action that has an alternative. That is, the actor has a choice between actions, whose consequences differ in the level of utility generated/destroyed.
(b) The experience of pain, physical or otherwise, is the only qualifier to be part of the moral community.
(c) Once in the moral community, all members have equal utility, intrinsic value, or rights.
(d) Certain animal species can experience pain.
Thus:
(1) Certain animal species are part of the moral community.
(2) Certain animal species have utility, value, or rights equal to that of humans.
(3) It is unethical to inflict harm on animals if you have the choice not to.
(4) Certain animal species (e.g. obligate carnivores) are not engaging in moral actions when hunting because they have no choice—aside from death, which eliminates their utility.
Therefore, speciesism is contrary to utilitarianism based on the experience of pain. The person to really popularize animal rights is Peter Singer. He is most famous for Animal Liberation (1975) and Practical Ethics (1979). His arguments are along the lines of what I just described above, but in much more detail. Consider also the backdrop of this time period, with the passing of the Endangered Species Act (1973), along with major amendments to the Clean Water Act, Clean Air Act, and other important legislations. The social and cultural zeitgeist along with the transmission of ideas from prominent academics all led to the current western conceptualization of animal rights.
NOTE: I mentioned “rights” and “intrinsic value,” and they are not terms normally used in consequentialism, the umbrella ethical theory that encompasses utilitarianism. Simply, the action that maximizes good consequences is the right action. Rights and intrinsic value are discussed in deontology, of which Immanuel Kant is one of the most famous proponents. Deontology rejects utility/consequences as the basis of ethics and relies on different principles. But, I digress, deontological arguments can be made for animal rights as well.