Just to add a bit more information to this topic, there are two types of hackers: Whitehats and Blackhats. (mainly) Whitehats are the hackers who hack in order to secure a system, first by exploiting it then by patching it. A Blackhat is a hacker who exploits a system and takes advantage of it by malicious means (virii, trojans, rootkits, etc.), otherwise known as a cracker. Aside from Whitehats and Blackhats, there are script kiddies and lamers. Script kiddies are the, usually, 10 year old kids who are to lame to learn about computers, the net, and the interworkings of things, and they just run some perl scripts or type in some google hacks (code that you type into google that let's you retrieve 'special' results, like inline:"hello" will find webpages with hello in their title) and deface a website. The lamers are people who read up on hacking, say they hack, but actually don't do anything at all, which in my opinion are the worst of them all.
Now to answer the question about hacking and the internet. Hackers use many techniques(sp). One technique is Brute Force/Dictionary Attacks and are used to crack into a website by testing multiple combinations of usernames and passwords, till one works. Another technique is SQL Injection and Cross Site Scripting. Other techniques include buffer overflows, injecting low level code (assembler/assembly) into a kernel, and just plain old telneting to a box and cracking the hash file. A hacker must learn a variety of information such as perl, C++, assembly, php, sql, kernel programming, unix, linux, windows xp and 2000 mainly, solaris (sometimes), ports, commands, file architecture, networking (packets, cookies, DNS, ARP posioning), encryption (Triple DES, Blowfish, Twofish, Serpent, Hash), and much much more.