Documentation has already cleared the difference between bytea and text:
There are two ways to distinguish binary strings and character strings. Binary strings help us to store octets of value zero and other non printable octets. Character strings do not allow zero octets and also disallow any other octet sequences of octet values that are invalid on the basis of the database's selected character set encoding. Second, operations on binary strings process the actual bytes, but the processing of character strings depends totally on locale settings. Therefore, binary strings are appropriate for storing data of raw bytes type.
If you want to get more insights into SQL, check out this SQL Course from Intellipaat.