"Then why isn't it included in the price? "
In some restaurants it is automatically added to the bill, though it is rare where I live.
The reason is that the service provider has a split loyalty. Everything from how time is alloted to various people and tasks, to whether they promote specials that are in the establishment's interest but perhaps not yours. Tips even that out, so that you are paying for the service directly and can influence the server so that you get good service.