An Encounter is something that happens when you go adventuring. Killed some goblins? its an encounter. Tripped a trap? Well it is an encounter as well, in fact most distinct things you will do that needs your action to complete is one, whether you feel someone bump into you in the market and find you money pouch oddly lighter then before or you see a monster and run from it, as long as you could have reacted and changed the outcome in a significant way.
In the later D&D editions when you mention an encounter most of the players reach for their dice because it has been for the most part reduced to fighting monsters or facing a trap. Even when it comes to role-playing a lot of it is reduced to roll-playing. Of course this is just how the game wants to be played, not the only way it can be played.
So you meet some humans in leather armor alone in the woods what do you do? You could reach for your dice to roll your initiative, or you could actually try to parlay. What people seem to forget is facing everything dice in hand is not always the best way to go. If you had assumed the humans where bandits and just attacked you will have missed out on that they where actually guards for a merchant caravan that was attacked not to far away. that is in need of help. Or maybe they where a party of fellow adventurers that where way above you level.
Attacking everything you meet no matter what it seems to be is a reaction caused by the quest for balance that games seem to have been on recently. 3rd edition D&D and forward have been trying to make every fight equal to the party. You walk into the forest at 1st level and you would meet a couple bandits or maybe some giant rats. Then of course you all level up so all of the sudden your fighting a couple wolves or a wild cat...
That is not how the world works nor is it how older editions work. If you don't know how to run from or go around monsters you will die. That is still an encounter though because you will have still done something of significances. Now this has all been nice but what is an encounter for?
Encounters are for a number of things actually. One is it breaks up a session into quantifiable parts. This lets you have a stopping point at the end of the night that is not an awkward cliffhanger. Middle of a fight would be a bad point to stop after all but after it would be a fine point to stop. An encounter can also work like chapters in a book. If a book was just a continual jumble of words all strung together it would be hard to find where you are. The mind remembers stuff better when its all in neat little packages so it can recall parts instead of the whole and encounters let you prepackage the mess for you mind. Encounters can also be easily swapped around to a point. Its the whole idea behind the random encounter tables for the wilderness. Your in the woods so maybe you meet some bandits but maybe you meet some cougars. Modularity allows DMs to rolls with the punches and keep going when the players go in the exact opposite way you want them to, because they will.
Finally don't let "encounters" take over the game. They are only artificial deliminators between one scene and another. If you let encounters worry you to much it can suck the fun out of the game. Just run the game and they will automatically appear. If the players are searching in a dungeon and making noise, if you haven't popped a monster on them recently do a random encounter. If they are in the wilderness tramping around in the middle of nowhere plop down a bear to spice it up some. When the players start to get bored, have stuff happen. As you DM more you will start to find the rhythm that suits your campaign.