The tram project began as a way to deal with the projected future demand of moving large volumes of people from North and North East Edinburgh to where they work (the city centre and the western business zones)
Leith Walk is historically extremely populated and the plans at the time were that Western Harbour and Granton Harbour would be equally so by today's date.
The 22 has over the years expanded and expanded and the city centre is at the tipping point where if you add more busses it will negatively impact every service.
So this is where light rail comes in. Every tram can take 3 busses of passengers and they load in a fraction of the time.
We currently have tram line that despite serving none of the core residential areas it was supposed to is staggeringly popular at rush hour.
I think I have said here in the past, because the City Centre is the end of the line, the "shop window" of the tram to passers by is really quite bad. That's because a good %age get off at Haymarket, Shandwick Pl, and so on. So it's easy to walk past one in St Andrew Sq, see the 5 passengers left going to York Pl, and be dismissive of it as a failure.