The main body Ida and the smaller asteroid, or moon, named Dactyl are a part of the family of asteroids found between the orbits of Mars and Jupiter. It is thought that all of these types of asteroids were created by some cataclysmic event which blew apart a larger body, perhaps around 200 to 300 km in diameter. This event (which is theoretical) would also have taken place long after the formation of the solar system and so in celestial terms it is considered a “recent” event. That means had this event not taken place we would have had at least one more dwarf planet in our solar system than we do today.
This flyby was planned as an “extra” for the Galileo mission as they were for the most part “on the way” to its central mission to the Jupiter system. It is thought that Dactyl has a nearly identical composition to Ida and is therefore not thought to be a “captured” moon, but rather one formed somehow from itslef either from a later impact or from the destruction of the originating body.