Two phrases share the same Arabic root and get said often enough to blur into one: inshallah (if Allah wills) and mashallah (what Allah willed). Their spellings are similar. Their grammar is parallel. Their use is opposite. Inshallah is what you say before something happens — at the moment of commitment. Mashallah is what you say after something has already happened — at the moment of admiration.
Mashallah is the Muslim response to beauty, success, a child smiling, a meal that turned out, a person doing well. It does two things at once. It credits the blessing to the One who actually willed it. And it protects the blessing from the envy that admiration can carry. Both functions come from the verse the phrase is taken from, and both functions are taught by the Prophet ﷺ as part of how the phrase is meant to work.
We covered all four short dhikr formulas briefly in the meaning of dhikr. Here is the full version of this one — the grammar, the verse, and what we are protecting when we say it.