Some of the things you will think are so simple that everyone knows them. Did you know that every F stop you close down requires twice the time to expose the film. Did you know the farther down you close your F stop the more depth of field you achieve. At F2.8 you can use a fast shutter speed but your depth of field may only be a inch or two. On the other hand f22 may give you a depth of field of many feet but will require a longer shutter speed.
Motion is stopped better at faster shutter speeds.
You have to be the judge as to where to balance the two for the best effect for your photograph. When you take a picture inside with a flash, shutter speed has little to do with the exposure. On the other hand shutter speed does determine the exposure of the window light. You first determine the F Stop you need for the flash light. Next you set the correct shutter speed for the F Stop you are using to the window light.