In this scene, Edmund does this because he is a treacherous piece of slime who is jealous of Edgar. Edmund wants to get rid of Edgar so that he and not Edgar can be the one who will inherit from their father.
In this scene, Edmund injures himself with his sword and then tells Gloucester that he got hurt while fighting with Edgar. He tells Gloucester that Edgar was part of a plot against him. Edmund gets Edgar to participate in a fake fight with him by telling Edgar that they need to do it so Edgar can get away.