You may only yield to NPCs whose disposition towards you is high enough or to a hostile guard by putting away your weapons. Combat can end in one of four ways: you are killed (which ends the game and requires you to load a previous save), all enemies that are hostile to you are killed, you move far enough away from an enemy that it ceases to attack you, or the combat is forced to end either by a magical effect (i.e. Anything that is hostile to you will appear as a red dot on your compass until combat with that particular hostile has ended.
Drawing too close to a potential enemy, attacking a non hostile NPC and, in some situations, selecting certain dialogue options are all grounds for causing something to attack you.
Combat normally begins when you or another NPC becomes detected by a hostile creature/NPC or otherwise provokes them into attacking.
All participants utilize combinations of physical attacks, weapons, or magic in an attempt to kill or overcome their opponent. Combat can take place between the player and/or any number of creatures and NPCs.