The single file which you can flash (I presume you are using Odin) contains all the files required for your firmware upgrade- which you place in PDA option of Odin
If you want to upgrade the firmware selectively, you would use one of the four files mentioned:
Bootloader file- not normally done for stock, mostly used for compatibility issues in version upgrade in flashing custom ROM. Example : MJ5 bootloader for flashing Note 4 ROM on Note 2
Code File is typically the ROM
Modem File is the radio component of ROM- you may want to replace a ROM meant for use in a different region and change the modem to get better performance by flashing modem file of your region. List of modems for your device can be searched on XDA forums. Example- Note 2 modems
CSC (variously referred to as Country/Carrier/Consumer Specific Code) File is the file you would want to use to change if you bought the phone in a different region and want to use it in your region (Samsung ROMs incorporate region specific features ) . Example
What is the exactly difference between these two?
I had overlooked this main question and realised I never probed this aspect. Googling leads me to the conclusion that the key difference is is it Odin ready (to be flashed as a single file or not?. While Odin and Kies are both Samsung proprietary, formats required for using them differ. using a Kies format and adapting to Odin requires extraction of files required.
Samsung firmware upgrade comes as a single file having the necessary files required for upgrade (Odin ready)
Samsung firmware is available on many sites, Sammobile is considered to be the most reliable out there. This site and other sites sometimes host upgrades/beta/test mode in Field Upgrade Serviceable (FUS) files which are not standard Odin flash ready files. But they can be flashed using Kies. Reason cited here for not being able to use directly on Odin is header file corruption. These need to be downloaded using apps like FUS downloader and then split into required files to be upgraded using Odin.You put these CSC, modem,bootloader files in the corresponding sections of Odin
Linked site(s) explain (Warning: Don't use PIT file which is available on splitting till you understand what it is for)
- To summarise, key difference lies in packaging of firmware (Odin Vs Kies), others being type of firmware (beta/ test/ tested/ leaked) and possible end use (complete or selective upgrade)
which one should be the best option for updating a device?
It depends on what you want to do-there is no specific answer, as for instance of flashing a modem only explained above. Or if your source upgrade file is Odin ready or not a explained above
If you are using Linux the method varies (not tried by me) and you can pretty much use either methods as outlined here
Samsung has a pretty confusing (till you get hang of it) of breaking down these components and labelling them. You can read here and here for starters.
And if you want to get deep into sources, see my answer Samsung firmware modifying