Bitcoin's whitepaper says that "A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution". That is, without a trusted third party. But in Bitcoin, instead of the third party being financial institution, it is miners who are in between. So, how bitcoin is peer to peer? And isn't the traditional method of payment, including PayPal etc., peer to peer?
miners who are in between
No, miners aren't in between. Miners around of block-chain, they are builders of the chain. *
* As Pieter Wuille says in the comment, anyone can be a miner, but in nowadays that's too hard to be a miner without special hardware.
And isn't the traditional method of payment, including PayPal etc., peer to peer?
No, that's also false, peer-to-peer doesnt have a centralized management.
Here is peer to peer (computer to computer for e.g.).
And here is centralized service like PayPal or whatever:
The PayPal has centralized management.
But for the end user, he just scans the paypal's code of the receiver and payment is done. Sender to receiver. So isn't this peer to peer?
You're simplifying things too much. For example the telephone call, you just speaks with a friend of yours directly, looks like peer-to-peer(friend-to-friend), but under the hood the phone provider in between you and your friend.
Bitcoin system is an overlay network(there need not be a physical direct connection among nodes, but at the application level it appears to be connected in a peer-to-peer fashion) among nodes participating in it.
In a centralized system, a central authority for e.g bank, government manages(in PayPal, the managers) all the transactions, balances that are with or related to a user. But in bitcoin ideally, every node keeps a record of account information corresponding to each user with itself (in the form of blockchain) and update it time to time. Practically due to resource constraints only fully validating nodes keeps a track of entire blockchain.
The role of a miner in bitcoin is purely to accumulate the transactions at a single place and add it to the blockchain. To avoid centralization by a single miner this task is randomized so that every node gets a chance to add to the blockchain depending upon the computation power spent by the nodes.