This might be a good read for you: How does KiCad know which symbol pin represents which pad of the footprint?