Summary
This is ultimately a matter of whether the device uses MSC or MTP/PTP. As a rule, dedicated storage devices like flash drives and external hard drives use MSC, while smartphones and other devices which need to maintain access to the data while connected to a computer or require control over the data transferred will use MTP. Many cameras use PTP, a subset of MTP.
If the device uses MSC, you'll need to eject it from the computer before you can remove it. If it uses MTP or PTP, ejection is not required.
Technical details
The Mass Storage Class (MSC) allows the computer to communicate with the drive in much the same way it would with an internal hard drive or SSD, making it faster than other protocols for transferring data. This is what dedicated storage devices like USB flash drives and external hard drives use. However, it requires block-level access to the underlying storage media, and that means exclusive access to the device. As a result, MSC is not okay for smart devices because they need to be able to access the contents of the filesystem while the computer is using it. A smartphone would effectively need to shut down its OS before it can grant block-level access to a computer—a cumbersome procedure, and one that would prevent you from running apps or otherwise using the device while it is connected. It is the computer's responsibility to ensure that the data has been completely transferred, so you need to tell the computer that you're done by ejecting it.
Media Transfer Protocol (MTP), which is what most smart devices use, involves file-level access, and the device, not the host computer, is responsible for managing the data. Smartphones use MTP because they need to be able to access the data while the device is connected to a computer. MTP also permits the device to control or limit what data can be transferred; some (primarily older) digital media/MP3 players use MTP to enforce copy protection (DRM) on files transferred or to ensure that the media files transferred are compatible with the device. As MTP simply presents a hierarchical file/folder structure, the computer does not need to worry about the filesystem or how the device stores data. In any case, with MTP, there is no need for an explicit eject command; once the device tells the system that the transfer is complete (the progress dialog has closed), you can remove the device without explicitly ejecting it.
MTP is a superset of Picture Transfer Protocol (PTP), which was originally designed for cameras communicating with computers. Many cameras still use PTP, but some support MSC, and some allow a choice between MSC and PTP. Furthermore, some cameras support direct printing through a protocol known as PictBridge, which requires PTP. As with MTP, PTP does not require an eject command. Whether a camera can use MSC, PTP, or both depends on how the camera handles its storage while connected to a computer.
Note that if you remove the memory card from a camera and insert it into an SD card slot or other media reader on your computer, it'll be an MSC device and you'll need to eject it when you're done transferring pictures.