When it comes to "too much" and "too many", they are chosen to be used based on the countability of the noun being modified.
First, let's look at "too much". When modifying uncountable nouns, we use "too much". Uncountable nouns are nouns that cannot be divided into individual units of counting, such as: water, food, love, time, etc. For example:
there is too much water in the bottle.(There was too much water in the bottle.) )
he ate too much food last night.(He ate too much food last night.) )
In these examples, "water" and "food" are both uncountable nouns, so we use "too much".
On the contrary, "too many" is used to modify a countable noun. A countable noun is a noun that can be counted individually, for example: book, apple, student, etc. For example:
there are too many books on the shelf.(There are too many books on the shelves.) )
she invited too many friends to her party.(She invited too many friends to her party.) )
In these examples, "books" and "friends" are both countable nouns, so we use "too many".
It is important to note that this is just a choice to use "too much" or "too many" based on the countability of the noun. Other sentence structure and grammar rules still apply.
In conclusion, "too much" is used for uncountable nouns and "too many" is used for countable nouns. This selection is based on the rules of countability and non-countability of nouns in English.