Legacy capabilities have been a huge source of confusion for Moodle administrators. The first thing to make clear is this: Legacy capabilities have nothing to do with the Predefined roles.
Legacy capabilities are a device created by developers to allow legacy code (i.e., code that has not been fully migrated to the new Roles and Capabilities system) to continue to function under the Roles and Capabilities system.
With my limited understanding of Moodle internals, I will try to explain how Legacy capabilities work. Prior to Moodle 1.7, Moodle would either do something or refuse to do something depending on a user's role: student, teacher, administrator, and so-on. If a user tried to attempt a quiz, for example, Moodle would (internally) ask isstudent(user) ("Is this user a student?") before permitting the quiz attempt, since only students were allowed to attempt quizzes under the old fixed roles system. Under the new Roles and Capabilities system, the equivalent question would be "Does this user have a capability 'Attempt quizzes' with the value Allow?" The full story is more complicated, thanks to multiple assignments and overrides, but I hope you get the idea.
Migrating Moodle to Roles and Capabilities was (and continues to be) a huge undertaking. It was not possible to complete the migration in time for Moodle 1.7. So What about the code that couldn't be fully migrated? It had to be at least partially migrated to keep it functioning, since questions like "Is this user a student?" were no longer valid questions. As a minimum, such questions had to be recoded, and the replacement code needed to be simple because of the time constraint. Legacy capabilities provided the solution.
More internals: Under Roles and Capabilities, Moodle can ask if a role has a particular capability. Specifically, Moodle can ask "Does this user have a role that has an X capability?". Notice that the value of the X capability (Allow, Prevent, etc.) is unimportant, but only its presence or absence of the capability in the role. I call a capability that is used this way a "marker capability."
A Legacy capability is an extra capability in a role that is used as a marker. For example, the predefined Teacher role contains the legacy capability LEGACY ROLE:Teacher. Everywhere that Moodle used to ask "is this user a teacher?" the code was changed to ask "does this user have a role that contains the capability LEGACY ROLE:Teacher?" Remember that these tests can only be found in code that has not been fully migrated. When the code has been fully migrated, legacy capability tests will be replaced by tests of specific capabilities (such as Attempt quiz = Allow). Eventually all of the legacy code tests have been replaced, and Moodle will no longer need legacy capabilities.
When you define a new role (either from scratch or by copying an existing role), or when you edit an existing role, you are allowed to select from a dropdown list labeled Legacy role type. If you remove the default Legacy capability from Guest, setting it to None, you will see some interesting results, since the tests that rely on the legacy capability will fail and the normal capabilities will take over.
As of version 1.9, Moodle still contains a fair number of of "legacy code" (code that relies on legacy capabilities) in both core and non-core modules. From what I can see, most the tests are isguest() tests. For example, the Forum module still tests for the legacy capability LEGACY ROLE:Guest to determine whether a user should be allowed to start new discussions or reply to posts. This can be frustrating if you've allowed those capabilities for Guest but you keep getting "Sorry, Guests can't post." Want to allow Guests to post to a forum? Fine. Remove the Legacy capability from Guest and override Can start discussions in the forum context. Boom. You're in.
Unfortunately, the legacy capability dropdown is only seen by the administrator, so teachers can't play with the legacy capability in a course context. That's probably by design, not an oversight.