You want to know what the Zoom button (the green one) does? Here's what it does: it toggles between user-managed size and app-managed size, where the user-managed size is the size that you last resized it to, and app-managed size is the size that the app thinks is the optimum size for the window's contents.
Did you understand all that? Yeah, it's not easy. Now you'll see why many developers simply give up, have it fill the screen, and cause people to call it the 'maximise' button instead.
As an example, as I click the button in the BBEdit window I'm typing this comment in, it resizes to take up the entire screen vertically (because you need lots of vertical space for coding), but only enough horizontal space to hold the sidebar and 80 characters of text (it depends on where you have your wrap margin set). It doesn't resize to lose any content out the window, it resizes to the optimum size. If I click it again, it resizes to the size I last manually set it to.
Honestly, I'm not sure quite why Apple added it in the first place, other than to have an aesthetically-pleasing three buttons: I use it rarely, much less often than maximising something in Windows. And it confuses people.