A Skittles factory helped shape a small-town economy and shows how US cities are attracting big companies