Can I get some info on meaning or purpose of attending a levayah of someone you knew? Like what's the idea behind it?
There are 2 purposes to attend a funeral.
1- For the relatives of the dead person. By going to the funeral you show that you are mourning with them their loss. It gives them strength to move forward when they see that others care.
2- It also gives honor to the dead person. The larger the crowd the more honor it brings.
In the morning prayers it is among the items that you get rewarded in this world and in the world to come "Ochel Pairoseihem BoOlam Hazeh Vhakeren Kayemes Lolam Habah". It is called a Chesed Shel Emes as there is no hope of repayment from the dead person.