CIAs always install to their intended location. games and stuff always install to SD card, DSiware and system titles install to NAND(if you try to force install to SD card, they won't work).
To be fair, it usually gets devapps wrong!
I've found this at https://github.com/Steveice10/FBI/b...a/source/ui/section/action/installcias.c#L125 :
"FS_MediaType dest = ((titleId >> 32) & 0x8010) != 0 ? MEDIATYPE_NAND : MEDIATYPE_SD;"
Without thinking too much over it, it appears to be choosing blindly depending on titleid-high; this fails to account for the convention where regular (00040000) apps are supposed to install to nand if their tid-low ends with a nonzero byte
Wink wink @Steveice10 :3