In many projects, I saw that data object/structure are written into file in binary mode, and then retrieve them back from the file in binary mode again.
I wonder why
If your program is the only program that is going to use the file, you can save internal structures "as is" using binary files.
However, if you want to exchange the files with other programs, or over the Internet, then binary formats are not that good. Think for example about the problem with big-endian vs. little-endian machines. Also, the receiver of the files or data will most likely not have access to your code and your structures, so a text-based format might be easier to parse and implement into own structures.
About performance, it's true that reading and writing your internal structures directly will be quicker, because you don't have to translate them (also known as marshaling) into another format.