The gambeson is a padded doublet. It used to be worn under the cuirass and covered the trunk, arms and partially also the legs. It protected from infections that could be created by wounds caused by the friction of the chainmail.
It began to be used at the end of the 10th century as we know it, but previously there were garments with a similar purpose, such as Roman subarmalis, for example.
For rank and file soldiers who couldn't afford chain mail, the gambeson was their only protection in battle, along with the helmet. Its decline was coupled with that of armor due to the appearance of firearms. It was no longer used in battle but was used as a garment.