Perhaps your essential hurdle is that you think you are editing a picture. This is not the case: you are editing a database, and an image is presented to you of the effects of your editing. The database is a collection of nodes and ways and relations, and from this database the generic map is produced by a process called “the renderer”. Many other applications also consult this database, to do their own things with it.