using a modding API is a lot easier than forking an entire source tree and building the application yourself

also, a lot of modding APIs present a cleaner interface than directly editing the source would. they also allow mods to be written in languages other than the base language of the game. the language chosen is usually lua, which is basically perfect for modding APIs due to its simplicity and ease of embedding