When you call wait() you are doing a very simple thing; your are asking "please tell me as soon as one or more sockets are ready or the timeout expires". If one or more sockets already have data waiting (are ready) then wait() returns true at once. If no sockets have data ready wait() blocks until at least one becomes ready and then it returns true. If no sockets are ready and none become ready before the timeout expires, then wait() returns false.
After wait() returns true you need to find out which sockets were the ones that were ready so you can go and read their data. And yes, multiple sockets can be ready and you don't know which ones until you have tested them all. And also yes, multiple sockets can become ready between two calls to wait() if the kernel receives data on them between the two wait() calls - in this case the second call to wait() will return immediately since sockets are already ready.
Regarding optimization: don't worry about it. Make simple robust code that is easy to reason about and is easy to prove is correct. Then later, if you run into performance issues, use a profiler to see what is causing the trouble and only then optimize those specific areas. And trust me, looping over 100 sockets to check them for readyness is not going to be a performance hotspot.