Speed — defines the priority of heroes' turns. The higher the speed is, the earlier a hero moves. Every hero has the initiative bar that fills with time. The amount of a hero's speed affects how fast the bar can be filled. With that in mind, a hero with, for example, 200 speed moves twice as fast as a hero with 100 speed.
Sometimes two or more heroes manage to fill their initiative bar at the same time. It can happen when you and your opponent have heroes of equal speed. If you and your enemy have got the same heroes, the one with more health has the upper hand. If the heroes are different, the one with less health takes action first. If all stats are equal, the order is random.