Desirable or engaging additional features and fittings or, as described in the US magazine Atlantic in October 1982, “Pentagon slang for extravagant frills.”
Originally, the phrase was used in a literal way in 18th and 19th century texts to refer to anyone or anything trying to make a lot of noise. Before modern electronics, there were really only two ways to make a loud warning noise: you either rang a bell or tooted a whistle. However, since the mid-19th century, it has been used to describe products such as cars, electronics and homes. For example, in the Wisconsin newspaper The Capital Times, June 1971, is a classified advertisement for a car: 69 Riviera: “One owner and driven very few miles, with all the bells and whistles, $3695.”
Where “bells and whistles” comes from is still a matter of debate, though it is American. One possible source is fairground organs. Not just an organ, this instrument had every form of instrument that could be banged, shaken or blown. “Bells and whistles” implies excess and that description fits the image of fairground organs.
It may also fit cinema organs. Instruments such as the Mighty Wurlitzer included sound effects to help the organist, among them car horns, sirens, and bird whistles. These effects were called toys, and organs often had toy counters with 20 or more noisemakers on them, including various bells and whistles.
Another possibility is that it derives from the work of the English cartoonist and sculptor Rowland Emett, whose creations were eccentric and whimsical. He was celebrated in the USA for the design of Chitty Chitty Bang Bang in 1968.
The explanation I like best, though, is the following, particularly because my sense of the phrase is that it’s older than mid-19th century, and railroads go back a lot farther than that. US railroad locomotives had both bells and whistles. These were apparently used for different signalling purposes and both were considered necessary, though not absolutely essential, parts of its equipment.
Or it may be that I’m prejudiced in favor of railroads since my father was a railroad engineer way back when.