When you compile an app you know the drill, configure, make, make install.. well new2dir is a script which slots in before 'make install' that sorts the app into it's folders ready for installation, It also can separate the main package, the nls stuff, the documentation and the dev related stuff so you can potentially end up with 4 separate directories which, if you have configured correctly, you can package up as pets.
You call it after "make" as "new2dir make install". The script asks you a series of questions about whether you want to separate the nls, doc stuff etcetera and gives you options. At the end you can optionally run dir2pet and it will run for every directory that is created, ie, the main, nls, doc, dev.
Of course not all sources include stuff for doc, nls, dev... some may only include the main package and the nls, such as the icewm I packaged recently.
Another cool thing you can do is run 'new2dir' and opt out of creating the pets. You can then go inside the directory and change stuff, like how I added the extra Puppy relevant stuff for icewm.