This video shows how hacking came to be and the logic and what hacking really is. Hacking is not only negative actions but it is divided into 3 categories black hat- illegal (bad) grey hat- both legal and illegal helps the community but at times does things that are illegal and white hat- such as security firms or individuals hacking for the security of others (good)

source