I had a similar issue with my keyboard. Over time, tiny particles and debris can get stuck under the keys. With regular use and normal wear and tear, the keys can become loose and, in some cases, even pop off accidentally.

How did I fix it?
I took it to the nearest service center. They have the right tools and expertise to fix it properly. In my case, they didn’t even charge me, even though my warranty had expired.
What not to do?
Don't try to forcefully fix it yourself. I watched some YouTube videos and read a few guides, but it didn’t help much. Worse, I accidentally bent one of the tiny clips that hold the key in place. Thankfully, I stopped before causing more damage and took it straight to the service center. If I had broken those delicate clips, I would have had to replace the entire keyboard—which isn’t cheap if you’re out of warranty or don’t have AppleCare.