Why Shiva is called Pashupati (पशुपतिः) ?
As mentioned in Mahabharata, Drona Parva chapter 202 verse 123 , this definition of Pashupati was told by Rishi Veda Vyasa to Arjuna.
सर्वथा यत् पशून् पाति तैश्च यद् रमते पुन: !
तेषामधिपतिर्यच्च तस्मात् पशुपतिः स्मृत: !!
ये सर्वथा पशुओं ( प्राणियों ) का पालन करते है और उन्ही के साथ खेला करते है, तथा पशुओं के अधिपति है, इसलिये “पशुपति” नाम से कहे जाते है !
He always nourishes the beings ( Pashus ) and he stays with them. Since he is the leader of all beings ( Pashus) , so he is called as Pashupati
Reference from Shiva Mahapurana:
There is a second reference mentioned in Shiva Mahapurana, Vayaviyasamhita – chapter 5 verse 12 (शिवपुराणम् -वायवीयसंहिता – अध्यायः 5), when Vayu devata explains to the group of Rishi, about the significance of Pasha (पाश), Pashu (पशु) & Pashupati (पशुपति)
अजडं च जडं चैव नियंतृ च तयोरपि ॥
पशुः पाशः पतिश्चेति कथ्यते तत्त्रयं क्रमात् !!
An object has three qualities – non-conscious ( Prakriti ) , Conscious ( Jiva ) and the controller of both ( Parameswara ). These three qualities are called as Pasha , Pashu and Pashupati in this order.
What does Pashu (पशु) means ?
Then again Vayu Devata explains it the verse 61-62
ब्रह्माद्याः स्थावरांतश्च पशवः परिकीर्तिताः – Starting from Lord Brahma to
immoveable things ( like trees, plants, organisms) are called as Pashu.
स एष बध्यते पाशैः सुखदुःखाशनः पशुः – this induvial is entangled in Pasha (पाशः) and he enjoys happiness and pain, therefore he is called as Pashu.