Regarding Bayesian estimation of the binomial distribution, while there are descriptions stating that the beta distribution is the conjugate prior, the derivations for the posterior and predictive distributions were often missing, so I have derived them here. Additionally, I have visualized the updates of the parameter distribution and predictive distribution using the Python programming language.
Conjugate Prior and Likelihood Function
Conjugate Prior
The conjugate prior for the binomial distribution is the beta distribution.
Beta(\mu | a, b) = \frac{\Gamma{(a+b)}}{\Gamma{(a)} \Gamma{(b)}} \mu^{a-1} (1-\mu)^{b-1}
I will describe the logarithmic form here as it will be used later. Note that the normalization term is treated as a constant.
\ln Beta(\mu | a, b) =(a-1)\ln \mu + (b-1) \ln (1-\mu) + \text{const.}
Let's examine the probability density function of the beta distribution. First, we vary the values of a and b while keeping a+b=10 fixed. You can see that the higher the proportion of a within a+b, the more the probability density function shifts to the right.

Next, we visualize how the distribution behaves as we increase the absolute values of a and b while keeping the ratio a/b fixed. It can be observed that the probability density becomes more concentrated as the absolute values increase.


Distribution for the Likelihood Function
The binomial distribution used for the likelihood function is as shown below:
Bin(x |n, \mu)= \binom{n}{x} \mu^x (1-\mu)^{n-x}
Visualizing the probability mass function. First, we fix n and vary \mu.

Next, when n is varied, the expected value and variance increase.

Derivation of the Posterior Distribution
Assume that data \mathbf{x} = \{x_1 \; x_2 \; \cdots x_N \} has been observed. At this time, from Bayes' theorem:
p(\mu | \mathbf{x}) \propto p(\mathbf{x}|\mu)p(\mu)
Taking the logarithm and grouping terms independent of the parameters into a constant term (hereinafter denoted as \text{const.}):
\begin{align*}
\ln p(\mu | \mathbf{x})
&\propto
\ln (\mathbf{x|\mu})
+
\ln p(\mu)
\\
&=
\ln \prod_{i=1}^N p(x_i|\mu)
+
\ln p(\mu)
\\
&=
\sum_{i=1}^N\ln p(x_i|\mu)
+
\ln p(\mu)
\\
&=
\sum_{i=1}^N\ln [\mu^{x_i} \:(1-\mu)^{n-x_i}]
+
\ln [\mu^{a-1} \:(1-\mu)^{b-1}]
+
\text{const.}
\\
&=
(\sum_{i=1}^N x_i) \ln \mu
+
\sum_{i=1}^N (n-x_i) \ln (1-\mu)
+
(a-1)\ln \mu
+
(b-1)\ln(1-\mu)
+
\text{const.}
\\
&=
(\sum_{i=1}^N x_i) \ln \mu
+
(Nn-\sum_{i=1}^Nx_i) \ln (1-\mu)
+
(a-1)\ln \mu
+
(b-1)\ln(1-\mu)
+
\text{const.}
\\
&=
[(\sum_{i=1}^N x_i)+a-1] \ln \mu
+
[(Nn-\sum_{i=1}^Nx_i)+b-1] \ln (1-\mu)
+
\text{const.}
\end{align*}
Note that the 5th line uses \sum_1^N n = Nn. By comparing the derived equation with the logarithmic form of the beta distribution mentioned earlier, it can be seen that the posterior distribution is as follows:
\begin{align*}
p(\mu|\mathbf{x})&=Beta(a',b')
\\
\text{Where,} &\; a'=(\sum_{i=1}^N x_i)+a),\;b'=(Nn-\sum_{i=1}^N x_i)+b)
\end{align*}
Visualization of the Posterior Distribution
We define the prior distribution as follows. We set the hyperparameters to a=1, b=1.
\begin{align*}
&
Beta(\mu|a,\;b)
\\
a&=1,\;b=1
\end{align*}
The likelihood function is as follows:
Bin(x | n = 5, \mu)= \binom{5}{x} \mu^x (1-\mu)^{5-x}
Suppose that \mathbf{x}=[3,4,3,5] is obtained. At this time, the posterior distribution is:
\begin{align*}
p(\mu|\mathbf{x})&=Beta(a',b')
\\
\text{Where,} &\; a'=(\{3+4+3+5\}+1),\;b'=(4*5-\{3+4+3+5\})+1)
\end{align*}
That is:
\begin{align*}
p(\mu|\mathbf{x})&=Beta(16,6)
\end{align*}
Comparing the prior and posterior distributions gives the following:

From the figure, it can be seen that the probability density distribution of the parameters, which was originally uniform, has changed to a distribution with a longer tail to the left.
By the way, the maximum likelihood estimator is \mu_{ML} = \frac{\sum_{i=1}^N x_i}{Nn} = \frac{3}{4}. For more details on maximum likelihood estimation, please refer to the following article as needed:
Expectation and Variance of Binomial Distribution, Maximum Likelihood Estimation, Visualization
Derivation of the Predictive Distribution
Consider p(x_\star). For convenience, we denote the hyperparameters as a, b.
\begin{align*}
p(x_\star)
&=
\int p(x_\star|\mu)p(\mu|a,b) \; d\mu
\\
&=
\int
\frac{n!}{x_\star!(n-x!)}
\mu^{x_\star} \:(1-\mu)^{n-x_\star}
\frac{\Gamma{(a+b)}}{\Gamma{(a)}\Gamma{(b)}}
\mu^{a-1} \:(1-\mu)^{b-1}
\; d\mu
\\
&=
\frac{n!}{x_\star!(n-x!)}
\frac{\Gamma{(a+b)}}{\Gamma{(a)}\Gamma{(b)}}
\int
\mu^{x_\star+a-1} \:(1-\mu)^{n-x_\star+b-1} \; d\mu
\\
&=
\frac{n!}{x_\star!(n-x!)}
\frac{\Gamma{(a+b)}}{\Gamma{(a)}\Gamma{(b)}}
\frac{\Gamma{(x_\star+a)}\Gamma{(n-x_\star+b)}}{\Gamma{(n+a+b)}}
\end{align*}
From the final line, we can see that assuming the parameters of the binomial distribution follow a beta distribution results in a beta-binomial distribution, defined as follows:
\begin{align*}
f(x)
&=
\binom{n}{x}
\frac{B(x+a,n-x+b)}{B(a, b)}
\\
&=
\binom{n}{x}
\frac{\Gamma{(x+a)} \Gamma{(n-x+b)}}{\Gamma{(n+a+b)}}
\frac{\Gamma{(a+b)} }{\Gamma{(a)}\Gamma{(b)}}
\\
&=
\binom{n}{x}
\frac{\Gamma{(a+b)} }{\Gamma{(\alpha)}\Gamma{(b)}}
\frac{\Gamma{(x+a)} \Gamma{(n-x+b)}}{\Gamma{(n+a+b)}}
\end{align*}
Note that the final line uses the following:
\frac{\Gamma{(a+b)}}{\Gamma{(a)}\Gamma{(b)}}
\int
\mu^{a-1} \:(1-\mu)^{b-1} \;d\mu=1
Substituting the previous results:
\begin{align*}
p(x_\star)
&=
\frac{n!}{x_\star!(n-x_\star!)}
\frac{\Gamma{(a'+b')}}{\Gamma{(a')}\Gamma{(b')}}
\frac{\Gamma{(x_\star+a')}\Gamma{(n-x_\star+b')}}{\Gamma{(n+a'+b')}}
\\
&=
\frac{n!}{x_\star!(n-x_\star!)}
\frac{\Gamma{(Nn+a+b)}}{\Gamma{(\sum_{i=1}^N x_i+a)}\Gamma{(Nn-\sum_{i=1}^N x_i + b)}}
\frac{\Gamma{(x_\star+\sum_{i=1}^N x_i + a)}\Gamma{(n-x_\star + Nn-\sum_{i=1}^N x_i+b)}}{\Gamma{(n+Nn+a+b)}}
\end{align*}
Visualization of the Predictive Distribution
To compare, we visualize the binomial distribution when \mu=0.5 and the beta-binomial distribution with the following parameters:
\begin{align*}
a= 16, \;b=6, \;n=5
\end{align*}

It can be seen that the predictive distribution also has a distribution with a long tail to the left.
References
(1) Kubokawa. 2017. "Foundations of Modern Mathematical Statistics". Kyoritsu Shuppan
(2) C.M. Bishop. "Pattern Recognition and Machine Learning, Vol. 1: Statistical Prediction based on Bayesian Theory". 2019. Maruzen Publishing
(3) Atsushi Suyama. "Machine Learning Startup Series: Introduction to Machine Learning through Bayesian Inference". 2018. Kodansha Scientific
(4) Wikipedia. "Beta-binomial distribution". 2022-11-2 (last edit)
Discussion