According to what I read, the compiler is not obliged to substitute the function call of an inline function with its body, but will do so if it can. This got me thinking- why do we have the inline word if that is the case? Why not make all function inline functions by default and let the compiler figure out if it can substitute the calls with the function body or not? 
inline is from C; it was not new to C++.

There are C keywords (register and inline) that were designed to allow the programmer to assist in code optimization.  These are generally ignored nowadays, since compilers can do better at register assignment and deciding when to inline functions (in fact, a compiler can either inline or not inline a function at different times).  Code generation on modern processors is far more complicated than on the more deterministic ones common when Ritchie was inventing C.

What the word means now, in C++, is that it can have multiple identical definitions, and needs to be defined in every translation unit that uses it.  (In other words, you need to make sure it can be inlined.)  You can have an inline function in a header with no problems, and member functions defined in a class definition are automatically effectively inline.
