The why, when you call cin>>option;, the user types in a number into the stream and then presses return, so the stream has something like '123\n' in it. The number part of the stream is taken out and put in ‘option’, leaving the '\n' in the stream.
Getline will read the contents of the stream up to the first '\n', as there is one in the stream already it immediately returns from the call with an empty string.
cin.ignore() flushes the contents of the stream, and getchar(); will remove the single ‘\n’ from the stream.
Another possibility is to use a combination of cin.sync() and cin.clear(), in that order. istream::sync discards all contents of the input buffer, and ios::clear clears the error bits (badbit, failbit and eofbit).
Note that istream::sync returns different values for different input streams, so be aware of the difference between buffered and unbuffered streams. In practice, unbuffered streams connected to cin aren't common in desktop computers and notebooks. There is also a chance of error with both functions, so take note of that too.