Sometimes, you need to export the compiled binary of your code for sharing with colleagues, or for programming your board using some other programmers like ISP programmer, or for OTA (Over-The-Air update) purposes. This exported binary (actually hex file for Arduino boards) will contain not only your application code, but also the source code of the dependencies in the hex format. The way to export this binary is the following −
Go to Sketch -> Export Compiled Binary
Now, navigate to the folder containing your sketch (your .ino file). You can use Sketch -> Show Sketch Folder for navigating to the sketch folder.
You will see two hex files in that folder.
Basically, these are the files that Arduino generates every time you compile/upload your sketch. By clicking on 'Export Compiled Binary', you specifically request Arduino to save these files for you to access/ share later on.
A word of caution if you are using the hex files to program the Arduino board separately, outside of Arduino IDE: Please note that if you are uploading to the Arduino board using an ISP programmer, it is preferred to choose the hex file with bootloader. If you choose the one without bootloader, then in some cases, it may overwrite the bootloader and you may not be able to program your board again. See the discussion here: https://forum.arduino.cc/index.php?topic=513626.0. All this is anyway for advanced users. If you are new to Arduino, better to stick to programming the board using the Arduino IDE.