In Sonic X, Tails' invention is wrecked by bullies in a forest. Not ready to give up on it, he later tracks down Sonic's plane and starts improving it.
Sonic returns mid-repair and asks what he is up to. The conversation that follows is friendly but guarded, and it is the beginning of the partnership. It is also the moment Sonic starts calling him Tails rather than Miles Prower, which tells you how the relationship is going to go.