The word "hack" carries at least three common meanings (setting aside the one about chopping trees).
The least common, used mostly among programmers, simply means coding for fun—possibly inspired by the sound of fingers tapping a keyboard. It has evolved to describe the fast, skillful production of code. There's no shortcut to learning it beyond taking classes, reading manuals, and joining communities.
A more common meaning, similar to "jury-rig," refers to repurposing something to do what it wasn't originally designed for—the LifeHacker blog is a good example. Within programming, this is generally seen as poor practice.
The most common meaning—and likely what you're asking about—involves finding vulnerabilities in software. The community splits into two camps: black-hat hackers (outlaws) who exploit flaws for gain or amusement, and white-hat hackers (lawmen) who report them to vendors so they can be fixed. Black-hats are also called crackers, though the public just calls them hackers.
Cracking is illegal and can land you in serious trouble—not only with the law but through malware hidden in supposed cracking tools that can compromise your own computer. White-hat hacking isn't illegal, but it's essentially the same skill and shouldn't be taught to just anyone who asks.