This is a very basic question but I never ran into this problem because I am new to Teensy. I did an internet search but this time too much information on this topic was not helpful!

Arduino has its Ethernet library (for example). Teensy also has its own Ethernet library with the same name.

How does the compiler know which one to use?

Thanks in advance.