How do Free-RTOS and mbed OS handle ethernet?
To generalize your question a bit: how does a system handle data that must be read from the hadware and is only lateron read by the software? (The inverse problem also exists, for instance in an mpeg player: data is generated in blocks, and is consumed at a fixed rate). Sorted by 'response time':


peripheral hardware often provides some buffering, ranging from the a-few-bytes buffer in a UART, to chains of data blocks in dedicated (multiported) RAM for Ethernet peripherals.
DMA (direct memory access) can be used to put data directly in the CPU RAM, without intervention from the CPU.
interrupts can be used to (temporary) get the CPU to handle an urgent task, like setting up a next data block for a Ethernet peripheral.
when the action that must be performed in response to an interrupts is more involved, the interrupt routine itself sets a flag, which causes the RTOS to switch to a task that handles the event.
when the response time is not very critical, the application can arrange that it polls the peripheral often enough to keep up with the data stream.
in a master-slave protocol the master controls when the slave will send data, so it can arrange for this to happen when it (the master) is listening (polling) for it.
when all else fails, the communication protocol can arrange for the data to be re-transmitted.