难怪 can be used to express that the speaker finds something unsurprising. It can be used alone or in a variety of different structures, as shown below.

难怪 as "it is not surprising that"
Here 难怪 is used to convey the speaker's lack of amazement at a situation, having recently acquired some new information that in his opinion explains it. It is used in much the same way as 怪不得, which can replace 难怪 in the structure without altering its meaning.

Structure 1

Examples

Xiǎo zhānɡ qǐnɡ jià le , nán ɡuài jīn tiān méi yǒu kàn dào tā.
小张 请假 了,难怪 今天 没有 看到 他。
Little Zhang asked for some vacation time, no wonder I haven't seen him today.

Structure 2 
Examples

Nánɡuài zhè lǐ rén zhè me duō, yuán lái zài dǎ zhé.
难怪 这里 人 这么 多,原来 在 打折。
No wonder there are so many people here. There's a sale going on.

难怪 as "is not to be blamed"
Structure
Examples

Nán ɡuài tā, tā hái shì ɡè hái zi ne, shén me dōu bú dǒnɡ.
难怪 他,他 还 是 个 孩子 呢,什么 都 不 懂。
Don't blame him. He's just a kid. He doesn't know better.

When used in this way it expresses that the speaker assigns no blame in the situation he is describing. Sometimes the specific person undeserving of blame is mentioned directly after 难怪, as in the first two examples. Often however the context makes clear who this person is and this is not necessary, as in the final example.

难怪 as "inevitable"
Similar to 难免,here 难怪 operates as an adjective meaning that something is inevitable.
Structure
Examples

Zhè me duō ɡōnɡ zuò, wànɡ yī jiàn shì nán ɡuài de.
这么 多 工作,忘 一 件 是 难怪 的。
With so much work to do, forgetting some is inevitable.