It appears you have a problem with the battery. When you charge with the laptop off - the battery receives more current than when the laptop is operating. This extra current might overheat a marginal battery
and cause the fan to operate at its highest setting (with more noise). If the battery iks a few years old it's time to replace it.