I have a pretty basic question that confuses me for some strange reason.
I have two tables, one is the table Pages and the other is the Menus. I am wondering, what is the benefits of using another table for mapping? Below is the two implementations that I am thinking:

The only difference I see is the way that I search.
For example in the first implementation:
a) if I want all the pages of a specific menu, I’ll query all the page_ids of the specific menu name and I’ll join them with the id of the table Pages (which is why I think this implementation is more slow).
b) if I want all the menus of a specific page I will search all the menus that have the page_id of the specific page.
In the second implementation is more typical and straightforward (and with more joins).
I think that the second implementation is the right one because it is faster (I guess, because it queries only between ids which is indexes instead of searching in menus names as I mentioned above in a)).
Or is there any other particular reason? Are these two designs identical in a matter of what they can accomplish or are there any other limitations in the first design and I always should choose the second one?
The two options are NOT identical; the latter is the correct choice to use in a many-to-many design. Using a joining table means that you can have many pages (A, B, C) and many menus (1,2,3) and you can associate a set of menus with a set of pages (yielding A1, A2, A3, B1, B2, B3, C1, C2, C3).
The first design assumes that any given menu can only have 1 page associated with it. Menu 1 can only be associated with one page (will it be A, B, or C?). To associate the same menu with multiple pages, you’ll need to have one row in your menu table for each associated page.