MongoDB and MySQL both store data and allow indexing and queries. This is what makes them both “databases”.
Its like having two people with very good memory recall that can instantly find what you are looking for.
Some other things that are the same are for example they can both recall something and then use that to do another recall or use that to recall specific things from another piece of data (joins and unions).
However, a major difference is WHAT can be recalled. In MySQL you have to already “know” what KIND of data to expect back. Its like asking someone for the time of their last dentist appointment. A person with good recall (databases) will be able to tell you exactly, however, with MySQL you know that answer WILL be a timestamp like “3PM on June 5th, 2024”, however, with MongoDB, the answer be anything. From a random number to a name of a food, even though you “asked” for the “time” the database takes no extra steps in ensuring what the actual type of data stored is.
Additionally, MongoDB allows nested data and array data types, whereas MySQL is completely flat.