Pep doesn't like injury-prone players, it messes with his plans, Aguero could have played a lot more games last season but was left kicking his heels on the bench.
Kompany experienced this as well but got back in the team late in the season and thankfully got that goal but he left of his own accord, a deal arranged a long time before the end of the season and probably whilst he was not being picked for the team.
Kompany has that goal to leave on a high, Aguero sort of stumbled out the door on the back of a missed panenka, sad really.