She supposedly takes Ritalin, which is banned in Japan, so that may be why she quit some of the events.
“A special arrangement is in place specifically for the Tokyo 2020 Olympic and Paralympic Games to allow athletes taking these medicines for therapeutic use, and with an approved Therapeutic Use Exemption, to import personal supplies for the treatment of their medical condition while they are in Japan,” a document provided via Team USA says.”
https://www.insider.com/simone-biles-adhd-meds-banned-japan-impacting-performance-2021-7
So according to this, she was allowed to take her stimulants.
https://www.politifact.com/factchecks/2021/aug/02/facebook-posts/no-evidence-olympics-barred-gymnast-simone-biles-u/
She quit because she was performing poorly and didn't want to soil her reputation. She knew the media would buy the excuse.