Lunar maria (plural form of the Latin word mare, which means sea) are
dark surfaces that can be found all over the moon (17% of the Moon is
covered in them) that have been created as a result of volcanic
eruptions. These areas are made up of basalt, and given that they seemed
almost waterlike, the astronomers in the distant past mistook them for
seas, whence their name comes.
When it comes to craters, their origin
is quite similar - volcanic eruptions created them. When lava starts
erupting from a volcano, it has to get out from somewhere - and thus
craters are created. If you are referring to lunar craters, however,
there are many speculations as to how they were created: due to volcanic
eruptions, meteoric impact, or glacier activity.