Where does the phrase “sailing under false colors” originate and What does it mean?

The phrase “sailing under false colors” means: Assuming to be what one is not; being a pretender or hypocrite.

This arose from the days of piracy on the high seas, when a pirate vessel, sighting a possible prey, hoisted the flag of a friendly nation to its halyards to allay suspicion while it drew within striking distance, thus catching the unsuspecting victim unprepared for defense.

But “under false colors” was in earlier use in a similar sense, denoting a man, sect, or even an army appearing in the garb or under the badge or insignia of a house or party of which he was not a member.

From this were derived such phrases as “to come out in one’s true colors” and “to show one’s colors”; that is, to reveal one’s true nature or standing.