yes the vaccines were designed according to the first variant of the sars-cov2 virus. However, the spike protein of delta variant changed a little, so it is more infectious and makes the immune response developed from first vaccination last for a shorter period, requiring boosts.
As far as T-cells and B-cells, they are actually B-lymphocytes and T-lymphocytes. The were always part of our immune system, and they are both white blood cells. When a new virus is detected, these lymphocytes must be created by our immune system. The vaccine triggers this, but also the sars-cov2 virus triggers this, but the virus attacks us before the immune system can create the correct lymphocytes. So, this is the purpose of the vaccine: to trigger creation of the correct lymphocytes without the harm of the virus. Our bodies keep copies of the lymphocytes around, but that fades over time, especially when new variants are encountered.
they did a better job of explaining it:
Learn how COVID-19 vaccines work and develop immunity to the virus.
www.cdc.gov