The painting is an example of an extended version of the standard presentation of the Holy Family, including the Parents of Virgin Mary. From the Middle Ages, presentations such as this are considered to be the main iconographic depiction of Jesus and Mary's relatives or spouse.
Paulina Chełmecka, "Holy Kinship (Holy Family with St. Anne and St. Joachim)", [in:] "The Sacred Lesser Poland Heritage", 2025, source: https://sdm.upjp2.edu.pl/en/works/holy-kinship-holy-family-with-st-anne-and-st-joachim