Indeed, this is a good question. There are many reasons for laughter and many types of it. We habitually associate laughter with joy but it can be mocking and rude. However, the private laughter that is not demonstrated publicly is perceived to be one of the safest options. After all, the person we are laughing at is not going to see or hear us. Well, hopefully, anyway.
In Genesis 18;12 Sarah laughs in the ultimate privacy of her tent, laughs בְּקִרְבָּ֣הּ with an assurance that nobody is going to ask her regarding the nature of this laughter. In Genesis 18:13 God asks Abraham the famous question, לָ֣מָּה זֶּה֩ צָחֲקָ֨ה שָׂרָ֜ה . Or HaChaim logically asks – if in Genesis 17:17 Abraham is laughing in response to a similar promise, then why did G’d react differently to the same word, צחק when used by two different people?
Or haChaim suggests the simple, yet elegant solution to the riddle without degrading Sarah’s spiritual level as some other commentators do. Somewhere between verses 12 and 13 Sarah has experienced the sudden return of her periods and thus, quoting Or haHaim, “she did not believe G’d’s promise until after she experienced proof on her own body. It was this that G’d objected to”.
Obviously, Sarah has learned her lesson realizing that neither anything can be hidden from God’s attention nor anything is too insignificant for His care. Still, it sounds more like a nervous laugh and not a mockery of God’s promises and abilities.