You mean mechanically, as in how are the properties enumerated and translated into columns in a SQL statement? Or are you thinking semantically, i.e. what gets translated and how does it map to one or more tables?
The mechanics really depend entirely on the language and what sort of information is available at runtime. In a native compiled language like C or C++ all information about the compile-time names of variables is lost post-compile, or in some cases post-link. Languages like these require some kind of preprocessor-based solution, typically, or they rely on external files in XML or some other format to provide the mapping.
In languages like Java or C# the runtime retains metadata about the types in the program, and this metadata could theoretically be used to enumerate the properties of a class and automatically map them into columns in a table. However, I think it would be tough to do this and always make intelligent choices. For example, which of the properties of a class identifies each instance uniquely, if any? Which represents columns that need indexes? What about variables that are collections of other classes? Do these get mapped into relations automatically? Or are they denormalized into the containing object? How do you tell what the cardinality of a relationship is?
You could have a hybrid system where there is some sensible default translation that can be overridden by an external file. But I don't know how valuable it would be. I personally don't like ORMs, and I don't use them unless I'm forced to. I think databases and runtime metaphors for organizing program code are different worlds with some abstract entities and concepts in common, and as I've said here before, databases will usually outlast applications by years or decades, so they should be designed to be useful as databases, not simply places to stuff instances. Another way of saying it: the database and the runtime classes are both concrete expressions of the abstract solution, with a layer to translate between them.