Here is a bit of text of the lorawan 1.0.3 specification:
923 6.1.2 Application identifier (AppEUI)
924 The AppEUI is a global application ID in IEEE EUI64 address space that uniquely identifies
925 the entity able to process the JoinReq frame.
926 The AppEUI is stored in the end-device before the activation procedure is executed.
And the relevant 1.1 specification:
1317 6.1.1.1 JoinEUI
1318 The JoinEUI is a global application ID in IEEE EUI64 address space that uniquely identifies
1319 the Join Server that is able to assist in the processing of the Join procedure and the session
1320 keys derivation.
1321 For OTAA devices, the JoinEUI MUST be stored in the end-device before the Join
1322 procedure is executed. The JoinEUI is not required for ABP only end-devices
Please note that between 1.0.3 and 1.1 the name of AppEui was changed to JoinEui.
The key derivation scheme for v1.0.3
And here is the key derivation scheme for v1.1:

So to answer your question:
- The AppEui (JoinEui) is used to derive session keys and to identify your node to the network server. It identifies your node together with the DevEui. The application server uses MQTT to subscribe to the datastream generated by the network server. At TTN this is done by this schema:
<AppID>/devices/<DevID>/<up/down>
. Downlink packets are handled on a gateway basis. The network server knows which gateways have received the uplink and chooses a gateway to transmit the downlink over.
If we look at thethingsnetwork than you can see how they determine which keys are part of which application. You link the appeui and deveui for every node to the application and the system will infer which packets are part of which application.
- The encryption scheme has changed between 1.0.3 and 1.1 as shown above by the images. But this doesn't matter much for an end user which just uses an library or API.
- AppEui's are allocated in a set space, just like MAC addresses and USB PID and VID numbers. The The Things Network has the address space starting with
70B3D57ED
allocated to it. But you can set your own AppEui if you have acquired one of your own. There is a button to customize the AppEui field and it will then allow you to set it.