Cyberpunk and steampunk. One takes place in the digital age, the other takes place in the industrial age. How can there be similarity, you wonder? Because of the word punk!
No, not the letters that spell out punk. The meaning of the word punk is what's important. The connotations it brings vary: rebellious, anti-authoritarian, unruly, individualistic, loud, do-it-yourself, unemployed, piercings, tattoos, colored hair, irresponsible, philistine, passionate, angry, energetic, fast music, cursing. Not all of these connotations are fair or justified; some are exaggerated, some are positive. They do, however, capture that punk means being apart from the status quo. The word isn't used to refer to a person just like everyone else.
In this sense, punk is an attitude. It is not doing something just because society, the government, or a corporation says so. It is life run independently, as opposed to simply following a script. It is being self-styled. As a genre, cyberpunk's most fascinating themes follow the meaning of punk.
Taking Neuromancer again, Case is trying to put himself on his own feet again, trying to escape the control of the mycotoxin preventing him from working in cyberspace. Molly has enhanced eyes and essentially works as a "street samurai". She even has an aura of being uncontrollable - she'll only act if she agrees with the objective. As a whole, the theme of Neuromancer is to become independent with technology serving as both a help and a hindrance.
The Difference Engine, a fantastic example of steampunk, is just as punk. Much of the conflict is about obtatining punch cards to run a program for placing winning bets. Edward Mallory is a paleontologist, but he defends the cards in a near-reckless manner. During an inversion layer caused by pollution, riots break out in London, so Mallory is in real danger without extensive police protection. Running life independently becomes a necessity - even a scientist can be punk. Again, technology brings about punk possibilities. Early computers can promote personal possibilities even if through gambling. Technology also brings about strife in terms of pollution caused by industrialization, thereby leading to civil unrest.
Setting may vary in the punk genres, but there is a prevailing punk attitude.