If you have Auto ISO set then when the internal flash is used the ISO defaults to 400. This is discussed on page 122 of the current user manual. You should review that page as there are at least four other conditions dependent on other settings that may apply and affect the end result.
It is also suggested you review the other pages in close proximity to 122. Page 124 for instance shows how to set up an Auto ISO range, i. e., the upper and lower limits.
Why would it underexpose at ISO 400? Quite simply the flash is only capable of putting out so much light and the lower the ISO the lower the maximum distance of proper exposure. If you were beyond that distance, and it is about 22 feet for ISO 400 (outdoors even less) images would be underexposed. Run the ISO up, that maximum distance increases. A table of range vs. ISO is shown on page 187 of the manual. Take note as well that the distance varies as a function of what lens (wide angle or telephoto) is mounted.
AS you can see here most of the questions you posed could be answered by going through the manual. I suggest you download a PDF and put it on a smartphone or tablet that you might commonly have with you. Great to have it handy and usually you can readily search the PDF version.