Research has shown that laughing has a definite social function, but it also may serve an evolutionary function as a way of demonstrating harmless playfulness to other humans, showing that we are intending to be friendly rather than threatening. Human beings aren't the only animals that laugh; apes are also known to laugh, particularly in conditions that also cause humans to laugh, such as a response to being tickled and a vocalization during play. People tend to laugh mostly when they are around other people, though some people may occasionally laugh out loud while they are alone, and laughter is such a big part of human vocalization that most people have different laughs that they use in different situations.
The use of different laughing sounds in different scenarios isn't necessarily an example of calculated, manipulative social affectation. For example, genuine, deep, unrestrained laughter may be considered socially unacceptable in some situations, so many people learn to tone down their natural full-on laugh for use in situations where they aren't 100 percent comfortable. This isn't necessarily a conscious choice, but it is something a lot of people do. Factors such as overall mood may influence the way people laugh, and while some people's laughs may seem to change in character and tone over time, science has shown that this is a pretty normal change.