- branches shows all branch-refs which are pointing exactly to the selected commit (they will be denoted by green/yellow boxes in the graph, too)
- on branches shows all branch-refs for which the selected commit is an ancestor reachable by following only "primary" parents, i.e. is part of the branch's "natural" history
- merged to branches shows all branch-refs for which the selected commit is an ancestor, but only reachable by following at least one merge parent (2nd or higher parent of a commit)
Git does not remember the (current) branch as part of a commit. However, when creating merge commits, Git always uses the currently checked out (branch that points to a) commit as first parent and the merged one as second parent. That way it's possible to find out which commits belong to the same branch (first parent) and which were merged (second parent).