Protect is a move that protects the user from any direct damaging and status moves. Indirect damage such as weather or status will still take effect, by status I mean if for example, you're Pikachu was already poisoned on the turn it uses protect. When used consecutively or with detect or endure, the chances of it failing increases
Also, z and max moves bypass protect but only deal a quarter of the damage. Unseen fist also completely bypasses protect if the user is using a contact move. On this page, you can find a list of moves that bypass protect completely
https://bulbapedia.bulbagarden.net/wiki/Protect_(move)
Counter is a move that if the user takes a physical hit, it will reflect double the amount. For example, if Wobbuffet takes 80 damage, counter will reflect 160 damage to the target. Since this move requires the user to get hit by a physical move, gettIng hit by a special move or not getting hit at all causes this move to fail. You can read about it more here
https://bulbapedia.bulbagarden.net/wiki/Counter_(move)