Why are some forms of harmful behaviour seen as criminal but others are not?

Why are some forms of harmful behaviour seen as criminal but others are not?