A moderate amount of it is just experience, (the kind you get by doing things yourself.) Like, which packet does what, how to make new handlers, etc.
Another part, which is crucial, is packet construction. Someone can teach you how to do it, but in this case, practice makes perfect. Just like...