It's hard to be sure but I'd say its a polyurethane type glue. I think one type is called gorilla glue. I've never used it in modelling but I know people do and it's very good stuff and doesn't dissolve foam like a solvent based glue would. Whether it sets soft, like you described, or not depends on the glue specification. Some polyurethane glues will set pretty dense. Others can form a lot or air bubbles and so the glue expands as it cures. The extreme of this being expanding foam which is also a type of polyurethane.
I guess tree is one of the right formula for modelling. I don't fly foam so I just use wood glue and the ever helpful CA (superglue ).