The argument is first split at commas in a sequence which is mapped taking into account the positions, so we can add & or \\ as needed.
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
\NewDocumentCommand{\matr}{m}
{
\begin{pmatrix}
\seq_set_from_clist:Nn \l__watson_matr_seq { #1 }
\seq_indexed_map_function:NN \l__watson_matr_seq __watson_matr_entry:nn
\end{pmatrix}
}
\seq_new:N \l__watson_matr_seq
\cs_new:Nn __watson_matr_entry:nn
{
#2 % the entry
\int_case:nn { #1 } { {1}{&} {2}{\} {3}{&} }
}
\ExplSyntaxOff
\begin{document}
[
\matr{a,b,c,d}
]
\end{document}

Can we generalize it? Yes.
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
\NewDocumentCommand{\matr}{O{2}m}
{
\int_set:Nn \l__watson_matr_size_int { #1 }
\begin{pmatrix}
\watson_matr:nn { #1 } { #2 }
\end{pmatrix}
}
\seq_new:N \l__watson_matr_seq
\int_new:N \l__watson_matr_size_int
\cs_new_protected:Nn \watson_matr:nn
{
\seq_set_from_clist:Nn \l__watson_matr_seq { #2 }
\seq_indexed_map_function:NN \l__watson_matr_seq __watson_matr_entry:nn
}
\cs_new_protected:Nn __watson_matr_entry:nn
{
#2 % the entry
\int_compare:nTF { \int_mod:nn { #1 } { \l__watson_matr_size_int } = 0 }
{ \ }
{ & }
}
\ExplSyntaxOff
\begin{document}
[
\matr{a,b,c,d}\ne\matr[3]{1,2,3,4,5,6,7,8,9}
]
\end{document}

If you're willing to accept a slightly different syntax, with semicolons for ending rows, you can easily produce matrices with different shapes and delimiters.
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
\NewDocumentCommand{\matr}{O{p}m}
{
\seq_set_split:Nnn \l__watson_matr_full_seq { ; } { #2 }
\begin{#1matrix}
\seq_map_function:NN \l__watson_matr_full_seq __watson_matr_makerow:n
\end{#1matrix}
}
\seq_new:N \l__watson_matr_full_seq
\seq_new:N \l__watson_matr_row_seq
\cs_new_protected:Nn __watson_matr_makerow:n
{
\seq_set_split:Nnn \l__watson_matr_row_seq { , } { #1 }
\seq_use:Nn \l__watson_matr_row_seq { & }
\
}
\ExplSyntaxOff
\begin{document}
[
\matr{a,b;c,d}\ne\matr[b]{1,2,3;4,5,6;7,8,9;10,11,12}
]
\end{document}

mlistpackage: https://mirror.foobar.to/CTAN/macros/latex/contrib/mlist/mlist.pdf. – Watson Mar 20 '21 at 17:32