It's simple. The rest 40M+ ppl in the city are "illegal immigrants". Which means no permanent residency, no health care, no education but only cheap labor.
Beijing is a province in itself with a lot of countryside and satellite cities (chanping, miyun, etc...). It would be weird to include nearby surrounding hebei.
Perhaps they meant Beijing and Tianjin combined + Langfang and Zhangjiakou? That could be around 40 million. Jingjinji (Tiānjīn, Beijing, Hebei) is around 130 million, but that includes all of hebei.