In some cases it may be difficult to demonstrate the the illegal use was willful. If you were at home with a laptop which was set to automatically connect to available wireless networks and your neighbour had a public network, you may connect unknowingly. If you connectly knowingly then the punishment would usually be a caution as stated by TechGirl.
The punisment for accessing illegal material via the internet would fall under a different law and would carry a different penalty.