What you are referring to is likely a preventative measure for the possibility of a double-spend attack. Due to the nature of the Proof-of-Work algorithm in Bitcoin, the likelihood of such event on a transaction with 6+ confirmations is very low due to probability and the cost implications of re-calculating X amount of blocks.
Is there any evidence that this actually does anything?
Suppose you have a large transaction that is very attractive to an attacker or someone looking to perform a double-spend attack. Once the transaction is included into its first block, it is considered to have 1 confirmation. Each block built on top of this chain adds to the number of confirmations of the transaction. This makes it increasingly difficult for a double-spend attack because the attacker would have to complete the same amount of computation (proof-of-work) to become the larger chain. In our example, 6 confirmations would require the attacker to mine 7 valid blocks to become large enough to be considered the valid chain. For example, having 20% of the total hash power of the network with 6 confirmations would yield a 1.42% probability of a successful attack. This number becomes exponentially smaller as the number of confirmations increases.
is this just to stop a theoretical attack from happening?
One important aspect of Bitcoin is that nodes will always favor the blockchain with the most amount of proof-of-work (longer chain), this is critical to preventing double-spending.
Has someone ever before manipulated a transaction on the bitcoin ledger
This is a slightly controversial question, and I would recommend reading this thread for various attack specifics.
The Bitcoin Wiki also has several charts and calculators that can be used to determine theoretical attack probabilities.