The given integral is:
\[
\int_{0}^{a} \frac{1}{4 + x^2} \, dx = \frac{\pi}{6}.
\]
1. Standard Integral Form:
The integral of \( \frac{1}{4 + x^2} \) is of the form:
\[
\int \frac{1}{a^2 + x^2} \, dx = \frac{1}{a} \tan^{-1}\left(\frac{x}{a}\right) + C.
\]
Here, \( a^2 = 4 \), so \( a = 2 \). The integral becomes:
\[
\int \frac{1}{4 + x^2} \, dx = \frac{1}{2} \tan^{-1}\left(\frac{x}{2}\right).
\]
2. Evaluate the Definite Integral:
Substitute the limits \( 0 \) to \( a \):
\[
\int_{0}^{a} \frac{1}{4 + x^2} \, dx = \left[\frac{1}{2} \tan^{-1}\left(\frac{x}{2}\right)\right]_{0}^{a}.
\]
This simplifies to:
\[
\frac{1}{2} \tan^{-1}\left(\frac{a}{2}\right) - \frac{1}{2} \tan^{-1}(0).
\]
Since \( \tan^{-1}(0) = 0 \), we have:
\[
\frac{1}{2} \tan^{-1}\left(\frac{a}{2}\right) = \frac{\pi}{6}.
\]
3. Solve for \( a \):
Multiply through by \( 2 \):
\[
\tan^{-1}\left(\frac{a}{2}\right) = \frac{\pi}{3}.
\]
Take the tangent on both sides:
\[
\frac{a}{2} = \tan\left(\frac{\pi}{3}\right).
\]
The value of \( \tan\left(\frac{\pi}{3}\right) \) is \( \sqrt{3} \), so:
\[
\frac{a}{2} = \sqrt{3}.
\]
Multiply through by \( 2 \):
\[
a = 2\sqrt{3}.
\]
Hence, the value of \( a \) is (B) \( 2\sqrt{3} \).