If it is MakeMaker, it writes the PREREQ_PM stuff into the Makefile and CPAN.pm then reads it. If it is Module::Build, it determines "requires" and "build_requires". We have not made a final agreement how CPAN.pm gets the information out of Module::Build. Ken suggested and my current repository version does it: to read and eval _build/prereqs which is around after Build.PL has run.
And in the future, down the road a bit, we may end up with something based on DOAP, but that's a fair way down the road.
Adam K