A Skittles factory helped shape the economy of a small town — and shows why cities want to attract companies