It is far more casual than anyone like to admit. Lots of jokes get through, little rebellions by junior officers tasked with inventing names. A classic example was "Operation Iraqi Liberation", an early name for the invasion of Iraq. Another may be an early program whereby ai/software selected targets for future strikes over Afghanistan: Skynet.
The FBI has fun with this, too. They named the investigation into rich parents buying their dumb kids into fancy universities "Operation Varsity Blues."