During a meeting with Pope Francis on Wednesday, U.S. first lady Melania Trump and President Donald Trump's daughter Ivanka Trump dressed in all black with veils covering their heads.

Yet only days before, while meeting the king of Saudi Arabia, the Trump women left their heads uncovered.

So why cover up in one country, and not in the other?

The answer lies in a complicated mix of personal preference, diplomatic protocol and religious dictates.

Image:
Pope Francis walks past Ivanka Trump, left, and Melania Trump. Alessandra Tarantino / Pool via AP

The lace veil — technically called a mantilla — has been worn in the presence of a Pope by many former first ladies, including Jackie Kennedy, Pat Nixon, Betty Ford, Rosalynn Carter, Nancy Reagan, Barbara Bush, Hillary Clinton, Laura Bush, and Michelle Obama, according to historian Carl Anthony of the National First Ladies' Library.

But when it comes to Saudi Arabia, the same first ladies didn't wear a headscarf or covering.

PHOTOS: Trump Family Tours Vatican, Meets With Pope

"In contrast, none of those incumbent first ladies who visited Saudi Arabia wore head coverings, since they were not meeting the single, recognized leader of the global Islamic faith, but rather political leaders where a cultural custom of head coverings by women is not 'required' by those visiting from other nations," Anthony told NBC News in an email.

Image: Barack and Michelle Obama meet Pope Benedict XVI
Former President Barack Obama and first lady Michelle Obama meet with Pope Benedict XVI, Friday, July 10, 2009, at the Vatican.Haraz N. Ghanbari / AP File

In Saudi Arabia, although women must cover their heads, female foreign dignitaries are not absolutely required to wear the headscarf.

But Anthony said many of those same first ladies who didn't wear a headscarf in Saudi Arabia, did at some point wear a headscarf when entering mosques or churches that were active places of worship.

When it comes to the Vatican's rules, women aren't technically forced to wear the mantilla, either. German Chancellor Angela Merkel and British Duchess Camilla both did not wear the mantilla when they met with the pope.

Merkel, however, wore black, which is the traditional color women wear when having a face-to-face with the pontiff. Some Catholic queens and princesses are allowed to wear white.

When Camilla met the Pope in April 2017, she dressed in white.