Different compiler toolchains do things differently. As discussed in the comments to your original question, some compilers convert source code directly into machine code, while others convert source code into assembly code (which serves as an intermediate representation), and then run that assembly code through an assembler to generate machine code. My experience is primarily with compilers that do the former, but Peter Cordes correctly pointed out that GCC does the latter. The actual implementation is mostly irrelevant, unless you're working on the compiler itself. Either one will produce the correct result, and neither has any relevant impact on the person who uses the compiler.
There is actually another alternative that fits conceptually somewhere between these two models. Clang (more specifically, LLVM) is an example of this. It compiles source code into an intermediate language, but rather than using architecture-specific assembly language as that intermediate representation, it uses IR (Intermediate Representation). In fact, this is the big innovation of the LLVM compilation model. The toolchain is implemented in three stages: there is a frontend that parses source code into IR code, an optimizer that performs optimization passes on the IR code, and then a backend that converts the IR code into machine code for a specific CPU.

This design allows a variety of frontends to be written for all sorts of source languages, as well as a variety of backends that target any CPU. The optimizer that sits in the middle is, however, the same in all cases, since it works on the intermediate IR code, which is always the same.

Other compilers may do something similar internally (so that it appears from the outside as a single step), or they may compile directly to architecture-specific machine code.
As for your specific question, what is the difference between "object code" and "machine code", there really is no difference. Object code generally refers to what you find in object files, such as ELF on *nix or PE on Windows, but this is actually just machine code.
As the name implies, machine code is machine-specific. Machine code for the x86 will only run on the x86 processor; ARM machine code only runs on the ARM processor; etc.
This is generated as the final stage of output by a compiler. It produces an object file, which contains object code, which is actually just machine code packed into an object file. However, object files often contain more than just machine code—they also contain tables for internal and external symbols, constant data, debugging information, etc. All of this is used by the linker when it generates the final executable image from these object files.
Although you didn't ask specifically about it, assembly code is just the human-readable form of machine code. Machine code is in a binary format that can be executed directly by the processor, whereas assembly code uses mnemonics that are easier for the programmer to read and write. For example, on x86, the object code might contain the byte 0x74, but in assembly language, this would be represented by the mnemonic JE
(or, equivalently, JZ
). An assembler is a program that converts assembly-language mnemonics into binary machine code.