Suppose we have $3$ random variables, $X, Y, Z$, which verify: $$I(X,Y), I(X,Z), I(Y,Z),$$ where $I(·,·)$ means the variables are independent, and $$D(Y,X \ | \ Z), $$ meaning $Y$ and $X$ are dependent given $Z$.
It is clear not a Bayesian Network neither a Markov Network can model this situation, with the problem mainly coming from the fact that these variables are independent to each other, and thus we cannot place any (directed or undirected) arc between them.
Choosing the empty DAG or graph misses the dependency above. A reasonable Bayesian Network is $Z \to X \leftarrow Y$. This v-structure guarantees it is not losing the information $D(Y,X \ | \ Z)$, but it is assuming $D(Z,X)$ and $D(X,Y)$. At least this can indeed be corrected by using the adequate parameters in the Conditional Probability Tables, i.e. making $P(X \ | \ Z ) = P(X)$.
Now it makes no sense to use a Bayesian Network here, and also all Bayesian Network structure learning algorithms will simply fail (*) building this structure and construct an empty DAG instead.
So, What can be done? Is there a probabilistic graphical model for this situation?
An example toy dataset descriptive of the situation above:
X Y Z
1 1 1
1 0 0
1 1 1
1 0 0
1 1 1
1 0 0
0 1 0
0 0 1
0 1 0
0 0 1
0 1 0
0 0 1
(*) (edited) This is not necessarily true. Actually, it depends on many factors, mainly the depth of the search, meaning it can, indeed, capture the dependency $D(Y,X | Z)$ and thus place the needed arcs. They will still find trouble detecting these types of dependencies in general graphs (this is a toy example)