Lay Summary Artificial intelligence (AI) technology has now been widely applied to social media. AI arranges posts based on user preferences and helps users easily create and share social media posts. AI-based algorithms underlying social media make decisions and initiate actions when interacting with human users, suggesting that machine agency and human agency coexist in human-machine interactions on AI-based social media. This study explores how TikTok users collaborate with AI, specifically focusing on the dynamics between human agency and machine agency, and how such dynamics shape user engagement. In-depth interviews with 25 TikTok users indicate that users are largely receptive to the personalized experiences offered by AI-enabled algorithms. Human users and AI-based algorithms also influence each other when the two interact, leading to human-AI synergy effects. Users try to train algorithms to provide a personalized feed that caters to their interests more precisely. AI also facilitates users' content creation and networking by reducing the efforts to exercise user agency. This study also finds that AI-user collaboration on TikTok influences user engagement with the platform and social-interactive engagement. These findings advance our understanding of how human agency driven by users and machine agency driven by AI collaboratively transform user engagement. Artificial intelligence (AI) technology has vastly reshaped user experiences on social media. AI-powered social media use and its outcomes largely depend on how users collaborate with AI that exercises agency. Through in-depth interviews with TikTok users, this study investigates how users collaborate with AI when using AI-powered social media and how such dynamics shape user engagement. We found that TikTok users are receptive to personalized experiences enabled by machine agency. However, by influencing each other, user agency and machine agency also led to user-AI synergy. Users deliberately influence content curation algorithms to make them cater more precisely to their needs; AI also facilitates users' content creation and networking. Such AI-user collaboration on TikTok significantly influences medium engagement and social-interactive engagement. These findings advance our understanding of the dynamics between human agency and machine agency and, thus, how AI transforms user experiences on social media.